#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
void GetScore(int* p, float* avg, int* num)
{
	int* tmp1 = p;
	int* tmp2 = p;
	float sum = 0.0;
	int i = 0;
	for(i = 0;i<10;i++)
	{
		sum += *tmp1;
		tmp1++;
	}
	*avg = sum / 10.0;
	for (i = 0; i < 10; i++)
	{
		if(*(tmp2+i)<*avg)
			(*num)++;
	}
}
int main()
{
	srand(824);
	int i = 0,num = 0;
	int p[10] = { 0 };
	for (i = 0; i < 10; i++)
	{
		*(p + i) = rand() % 101;
	}
	float avg = 0.0;
	GetScore(p,&avg, &num);
	for (i = 0; i < 10; i++)
	{
		printf("%d ", *(p + i));
	}
	printf("\navg=%.1f num=%d\n",avg,num);
	for (i = 0; i < 10; i++)
	{
		if (*(p + i) < avg)
			printf("%d ", *(p + i));
	}
	return 0;
}